package com.soundsystem;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Config {
    @Bean
    //如果在bean定义的时候不指定@Qualifier的值，则值默认为bean名称，则@Autowired端使用时@Qualifier的值则填bean名称
    @Qualifier("iceCream_q")
    public Dessert iceCream(){
        return new IceCream();
    }

    @Bean
    @Qualifier("popsicle_q")
    public Dessert popsicle(){
        return new Popsicle();
    }
}
